package flow.model;

import java.awt.Color;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;

import flow.conf.GraphConstant;

public abstract class Element {
	public int type;
	public Boolean selected = false;

	

	protected int id;
	protected Color color;
	public String name;
	
	public abstract Shape getShape();
	public abstract boolean near(int x,int y);
	public Element(Color color, int type) {
		this.color = color;
		this.type = type;
	}

	public Color getColor() {
		if (selected)
			return GraphConstant.DEFAULT_SELECTED_COLOR;
		return color;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setColor(Color color) {
		this.color = color;
	}
	
	
	// protected Shape shape;
	// protected Rectangle2D.Double bounds;

	// protected Ellipse2D circle;
	// public abstract Shape getShape();
	// public abstract void move(double x,double y);
	// public abstract void setShape();
	// public abstract java.awt.Rectangle getBounds();

	/*
	 * public void setShape(Shape shape) { this.shape = shape; }
	 */

	/*
	 * public Rectangle2D.Double getBounds() { return bounds; }
	 * 
	 * public void setBounds(Rectangle2D.Double bounds) { this.bounds = bounds;
	 * }
	 */

	/*
	 * public void rename(String name){ this.name=name; }
	 */
	// public abstract void remove() ;
}
